package com.aier.service.invoice;

import com.aier.bean.invoice.HengdaInvoice;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.InputStream;
import java.io.UnsupportedEncodingException;
import java.util.List;
import java.util.zip.ZipOutputStream;

/**
 * 恒达发票mapper
 */
public interface HengdaInvoiceService {
    /**
     * 添加恒达货代发票信息
     * @param hengdaInvoice
     */
    void saveHengdaInvoice(HengdaInvoice hengdaInvoice);

    /**
     * 根据fba码获取恒达货代发票信息
     * @param fbaCode
     * @return
     */
    HengdaInvoice getHengdaInvoiceByFba(String fbaCode);

    /**
     * 修改恒达货代发票信息(根据fba修改)
     * @param hengdaInvoice
     */
    void modifyHengdaInvoice(HengdaInvoice hengdaInvoice);

    /**
     * 根据fba删除恒达货代发票信息
     * @param fbaCode
     */
    void removeHengdaInvoice(String fbaCode);

    /**
     * 根据员工信息 获取员工需要填写的发票信息
     * @param staffId
     * @return
     */
    List<HengdaInvoice> getHengdaInvoiceByStaffId(String staffId);

    /**
     * 更新或添加恒达货代信息
     * @param hengdaInvoice
     * @return
     */
    void modifyOrInsertHengdaInvoice(HengdaInvoice hengdaInvoice);

    /**
     * 循环写到zip输出流中
     * @param request
     * @param response
     * @param hengdaInvoiceList
     */
    ZipOutputStream batchExportCargoOrderTmpZip(HttpServletRequest request, HttpServletResponse response, List<HengdaInvoice> hengdaInvoiceList) throws UnsupportedEncodingException;


    /**
     * 获取模板填充数据后的inputString
     * @param hengdaInvoice
     * @param templatePath
     * @param response
     * @throws IOException
     */
    InputStream getFillFileInputStream(HengdaInvoice hengdaInvoice, String templatePath, HttpServletResponse response) throws IOException;
}
